<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

return new class extends Migration
{
    /**
     * Run the migrations.
     */
    public function up(): void
    {
        Schema::create('sys_dict_types', function (Blueprint $table) {
            $table->id();
            $table->string('name', 50)->default('')->comment('类型名称');
            $table->string('code', 50)->default('')->unique()->comment('类型编码');
            $table->tinyInteger('status')->default(0)->comment('状态(0:正常;1:禁用)');
            $table->string('remark', 255)->nullable()->comment('备注');
            $table->index('code');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     */
    public function down(): void
    {
        Schema::dropIfExists('sys_dict_types');
    }
};
